%h3.page-title
  Issue ##{@issue.iid}

  %small
    创建于
    = @issue.created_at.stamp("2013-01-01 14:00:00")

  %span.pull-right
    = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do
      %i.icon-plus
      New Issue
    - if can?(current_user, :modify_issue, @issue)
      - if @issue.closed?
        = link_to '重新打开', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put,  class: "btn grouped reopen_issue"
      - else
        = link_to '关闭', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue"

      = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do
        %i.icon-edit
        编辑

.pull-right
  .span3#votes= render 'votes/votes_block', votable: @issue

.back-link
  = link_to project_issues_path(@project) do
    &larr; To issues list


.ui-box.ui-box-show
  .ui-box-head
    %h4.box-title
      - if @issue.closed?
        .error.status_info Closed
      = gfm escape_once(@issue.title)

  .ui-box-body
    %cite.cgray
      创建: #{link_to_member(@project, @issue.author)}
      - if @issue.assignee
        \ 当前分配: #{link_to_member(@project, @issue.assignee)}

    - if @issue.milestone
      - milestone = @issue.milestone
      %cite.cgray 并连接到里程碑: 
      %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)

    .pull-right
      - @issue.labels.each do |label|
        %span{class: "label #{label_css_class(label.name)}"}
          %i.icon-tag
          = label.name
        &nbsp;

  - if @issue.description.present?
    .ui-box-bottom
      .wiki
        = preserve do
          = markdown @issue.description

- content_for :note_actions do
  - if can?(current_user, :modify_issue, @issue)
    - if @issue.closed?
      = link_to '重新打开 Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put,  class: "btn grouped reopen_issue"
    - else
      = link_to '关闭 Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue"

.participants
  %cite.cgray #{@issue.participants.count} participants
  - @issue.participants.each do |participant|
    = link_to_member(@project, participant, name: false, size: 24)

.voting_notes#notes= render "projects/notes/notes_with_form"
